package com.jd.jstable.strategy;

import com.jd.jstable.config.KeyMode;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.lang.reflect.Method;

/**
 *
 * Created by chenyipu on 2018/1/10.
 */
public abstract class Strategy {
    private static final Log logger = LogFactory.getLog(Strategy.class);
    public Strategy(){
        logger.info(String.format("Strategy Load Ready[%s]", this.getClass()));
    }
    /**
     * 针对调用者函数的入参提出解决方案并返回结果
     * @param invoker
     * @param method
     * @param args
     * @param param 用户配置在注解的参数
     * @param keyMode
     * @return
     */
    public abstract Object solve(Object invoker, Method method, Object[] args, String param, KeyMode keyMode);
}
